﻿#define _CRT_SECURE_NO_WARNINGS 1

//编程初学者入门训练第八十三题
//BC85 包含数字9的数
//https://www.nowcoder.com/practice/0948f4f3344c452f843afd3585dd0f8d?tpId=107&tqId=33366&rp=1&ru=/exam/oj/ta&qru=/exam/oj/ta&sourceUrl=%2Fexam%2Foj%2Fta%3Fpage%3D2%26tpId%3D107%26type%3D107&difficulty=undefined&judgeStatus=undefined&tags=&title=

#include <stdio.h>

int main() {
    int count = 0;
    //遍历1~2019
    for (int i = 1; i < 2020; i++) {
        int tmp = i;
        while (tmp != 0) {
            if (tmp % 10 == 9) {
                count++;
                break;
            }
            else {
                tmp /= 10;
            }
        }
    }
    printf("%d\n", count);
    return 0;
}